package com.region.http.client.utils;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * @author liujieyu
 * @date 2023/9/3 15:09
 * @description
 */
public class LockUtils {

    private static final ReadWriteLock lock = new ReentrantReadWriteLock();

    /**
     * The read lock
     *
     * @return
     */
    public static Lock getReadLock() {
        return lock.readLock();
    }

    /**
     * To write lock
     *
     * @return
     */
    public static Lock getWriteLock() {
        return lock.writeLock();
    }

}
